package com.example.project.projectspringcloud.entity.user;

import com.example.project.projectspringcloud.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = false)
public class Role extends BaseEntity {

    private String name;

    private String description;

    private Integer level;

    public Role() {

    }

    public Role(Integer id) {
        setId(id);
    }

    @Override
    public boolean equals(Object o) {
        if(o == null) {
            return false;
        }
        else {
            Role role = (Role) o;
            if(role.getId().equals(this.getId())) {
                return true;
            }
        }
        return false;
    }
}